#pragma once
//------------------------------------------------------------------------------
/**
    @class Models::ShapeNode
  
    ModelNode which describes a simple static shape. Since the ShapeNode
    is derived from the StateNode (which in turn is derived from the
    TransformNode), a ShapeNode contains all the necessary information
    for rendering a mesh.
    
    (C) 2007 Radon Labs GmbH
*/    
#include "statenode.h"

//------------------------------------------------------------------------------
namespace Models
{
class ShapeNode : public StateNode
{
    __DeclareClass(ShapeNode);
public:
    /// constructor
    ShapeNode();
    /// destructor
    virtual ~ShapeNode();

	// write data to stream
	virtual bool WriteDataTag(Ptr<ToolkitUtil::ModelWriter>& writer);
	
    /// set mesh resource id
    void SetMeshResourceId(const Util::String& resId);
    /// set primitive group index
    void SetPrimitiveGroupIndex(IndexT i);
	/// get primitive group index
	IndexT GetPrimitiveGroupIndex() const;


protected:
	Util::String meshResId;
    IndexT primGroupIndex;
};

//------------------------------------------------------------------------------
/**
*/
inline void
ShapeNode::SetMeshResourceId(const Util::String& resId)
{
    this->meshResId = resId;
}

//------------------------------------------------------------------------------
/**
*/
inline void
ShapeNode::SetPrimitiveGroupIndex(IndexT i)
{
    this->primGroupIndex = i;
}

//------------------------------------------------------------------------------
/**
*/
inline IndexT 
ShapeNode::GetPrimitiveGroupIndex() const
{
	return this->primGroupIndex;
}

} // namespace Models
//------------------------------------------------------------------------------
